#!/bin/bash

# 脚本：检查当前环境是否满足运行条件,并修复

# 更新软件源
apt update

# 依赖工具
apt-get install bison flex wget vim git curl build-essential -y
apt-get install cmake gcc g++ -y
apt-get install libboost-all-dev libasio-dev libmodbus-dev -y

# Crow库
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo -e "更新Crow库~~~"
git submodule update --init

cd 3rdparty/Crow && mkdir -p build && cd build

cmake .. -DCROW_BUILD_EXAMPLES=OFF -DCROW_BUILD_TESTS=OFF

make install 

cd ../../

echo -e "更新Crow库~~~完成！"
echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"